import request from "@/utils/request";
import {Ref, UnwrapRef} from "vue";

export const getTeamList = (currentPage: number, pageSize: number, status: number,userId: number) => {
    console.log("status?:", status)
    return request({
        url: '/team/list',
        method: 'post',
        data: {
            currentPage,
            pageSize,
            sortField: "id",
            sortOrder: "ascend",
            status,
            userId
        }
    })
}
export const createTeam = (teamName: string, password: string, description: string, maxPerson: number, expireTime: number, userId: number, status: number) => {
    return request({
        url: '/team/create',
        method: 'post',
        data: {
            teamName,
            password,
            description,
            maxPerson,
            expireTime,
            userId,
            status
        }
    })
}

export const joinTeam = (teamId: number, userId: number,password: string) => {
    return request({
        url: '/team/join',
        method: 'post',
        data: {
            userId,
            teamId,
            password
        }
    })
}

